package pw.http.proxy.utils;

import java.math.BigInteger;
import java.security.MessageDigest;

/**
 * @Author Eric
 * @Desc
 * @Date Create in 18-1-12 下午1:50
 * @Modified By
 */
public class IdKit {
    public static String md5(String url){
        try {
            // 生成一个MD5加密计算摘要
            MessageDigest md = MessageDigest.getInstance("MD5");
            // 计算md5函数
            md.update(url.getBytes());
            return new BigInteger(1, md.digest()).toString(16);
        } catch (Exception e) {
            System.out.println("MD5加密出现错误");
            return "";
        }
    }
}
